#include "WorkManager.h"

using namespace std;
using namespace tbb;


WorkManager::WorkManager()
{
	_works = new WorksVector();
}

WorkManager::~WorkManager()
{
	delete _works;
}

void WorkManager::EnqueueWork(TcpConnection *connecton, ConnectionCallback work)
{
	_works->push_back(Delegate(connecton, work));
}

WorksVector *WorkManager::DequeueWorks()
{
	WorksVector *result = _works;
	_works = new WorksVector();
	return result;
}
